# -*- coding = utf-8 -*-
# @Time : 2022/1/12 20:42
# @Author : GHHHHHHHHH
# @File : getColors.py
# @Software : PyCharm

from json_open_close import *

def initColors(num):
    colors = []
    numP3 = num//3 + 1
    for i in range(num):
        if i < numP3:
            colors.append((255 // (numP3 + 1) * (i + 1), 0, 0))
        elif i < numP3 * 2:
            colors.append((0, 0, 255 // (numP3 + 1) * (i - (numP3) + 1)))
        else:
            colors.append((0, 255 // (numP3 + 1) * (i - (numP3) * 2 + 1), 0))
    save_json("colors.json", colors)
    return colors
